<?php

namespace App\Models\GameDB\Frag;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class FragmentUserRecord extends Model
{
    public $connection = 'mysql_game';

    protected $table = 'lottery_frag_draw_fragment_user_record';

    protected $primaryKey = 'id';

    public $timestamps = true;

    public function user()
    {
        return $this->hasOne(\App\Models\MainDB\User::class, 'id', 'user_id');
    }

    public function user_data()
    {
        return $this->hasOne(\App\Models\MainDB\UserData::class, 'user_id', 'user_id');
    }

    public function send_gift()
    {
        return $this->hasOne(\App\Models\MainDB\Gift::class, 'id', 'send_gift_id');
    }

    public function fragment_group()
    {
        return $this->hasOne(FragmentGroup::class, 'id', 'fragment_group_id');
    }

}
